#!/bin/bash
/usr/local/bin/inotifywait --exclude "temp|log|swp|swx" -mrq  -e close_write,delete,create,attrib,move /bc/app/nginx/conf/ |while read events
do
    echo ${events} >>/bc/log/inotify/inotify.log
    /usr/bin/rsync -vzrc --delete --progress /bc/app/nginx/conf/ bc@10.10.4.76::testnginx2/ --password-file=/etc/rsync_root.password
    ssh root@10.10.4.76 "/etc/init.d/nginx reload"
done
